package com.sy.action;

import com.opensymphony.xwork2.ActionSupport;
import com.sy.util.FileWrapper;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;

public class DynamicTreeAction extends ActionSupport implements ServletRequestAware {

	private static final long serialVersionUID = 5200762895852618348L;

	    private HttpServletRequest request;
	    private FileWrapper root;

	    public void setServletRequest(HttpServletRequest request) {    
	        this.request = request;
	    }
	    
	    public FileWrapper getRoot() {
	        return root;
	    }
	    
	    @Override
	    public String execute() {
	        root = new FileWrapper(request.getSession().getServletContext().getRealPath("/"));        
	        return SUCCESS;
	    }
	}
